package cn.itcast.feign.config;

import feign.Request;
import feign.Retryer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class UserServiceFeignConfig {

    @Bean
    public Request.Options options() {
        return new Request.Options(
                3000, // 连接超时 3s
                6000  // 读取超时 6s
        );

    }

    @Bean
    public Retryer retryer() {
        return new Retryer.Default(500, 2000, 2); // 可选：自定义重试策略
    }
}
